package com.itheima.Map;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MyMap2 {
    public static void main(String[] args) {
       Map<String,String>map=new HashMap<>();
        map.put("1号丈夫","1号妻子");
        map.put("2号丈夫","2号妻子");
        map.put("3号丈夫","3号妻子");
        map.put("4号丈夫","4号妻子");
        map.put("5号丈夫","5号妻子");
        //获取到所有的键
        Set<String> keySet = map.keySet();
        //遍历集合
        for (String s : keySet) {
            //获得键来找对应的值
            String value = map.get(s);
            System.out.println(s+"   "+value);
        }

    }
}
